package com.zszq.ms.bigmodeltest.controller;

import com.zszq.ms.bigmodeltest.domain.response.Result;
import com.zszq.ms.bigmodeltest.entity.AiTemplate;
import com.zszq.ms.bigmodeltest.service.AiTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  模板前端控制器
 *
 * @author ms
 * @since 2025-03-31
 */
@RestController
@RequestMapping("/aiTemplate")
public class AiTemplateController {
    @Autowired
    private AiTemplateService aiTemplateService;

    /**
     *  添加数据
     *
     * @param aiTemplate 实体类
     * @return 结果
     */
    @PostMapping("/add")
    public Result add(@RequestBody AiTemplate aiTemplate) {
        return Result.success(aiTemplateService.add(aiTemplate));
    }

    /**
     * 修改数据
     *
     * @param aiTemplate 实体类
     * @return 结果
     */
    @PostMapping("/update")
    public Result update(@RequestBody AiTemplate aiTemplate) {
        return Result.success(aiTemplateService.update(aiTemplate));
    }
}
